Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Displaying Rendered • View rawDownload


docs/agents/skills/android-webview-bridge/SKILL.md e0f1f99cd1c208c5008a936230c38e448dddd45d (e0f1f99c) Text, 2.94 KB

Skill: android-webview-bridge

Keep Chaquopy backend boot, WebView file choosers, storage locks, and external navigation correct on Android.

When to use

• Changing T383838MainActivity bridges, file pickers, or storage setup
• Touching Android Python wrapper / Chaquopy packaging
• Identity or database restore pickers on Android
• Debugging empty file pickers or "fresh install" after storage location change

File chooser

• Extension tokens like T383838.identity are not valid MIME types for T383838Intent.EXTRA_MIME_TYPES.
• Map T383838.ext accepts to T383838application/octet-stream and/or T383838*/*.
• Set T383838EXTRA_ALLOW_MULTIPLE only when the WebView chooser mode is multi-select.

Storage and lock

• Internal vs external app storage can look like a fresh install if the user picks a different location than previous data.
• T383838fcntl.flock may be missing. T383838StorageLock falls back to a PID soft lock.
• Stale T383838.meshchatx.lock may need clearing in the Chaquopy wrapper path.

Navigation and packaging

• External http(s) links open in the system browser. Do not navigate the WebView away from the app.
• Vendored T383838lxmfy and T383838rns_filesync are synced into Chaquopy T383838src/main/python/. Android pip does not install them like desktop setuptools.
• RNS panic containment matters on Android (see T383838deferred-network-startup).

RNode on Android

• Chaquopy has no pyjnius. Ship T383838android/app/src/main/python/jnius/ as a shim over T383838java.jclass.
• Override T383838usb4a under T383838android/app/src/main/python/usb4a/ and inject the Activity via T383838meshchat_wrapper.start_server(..., activity).
• BLE uses bundled T383838able plus T383838org.able.BLE (not Kivy PythonActivity).
• RNode flasher is native T383838RNodeFlasherActivity (USB via T383838UsbSerialHub, ESP32 ROM flash in Java). WebView only launches it via T383838openRNodeFlasher().
• Codec2 requires T383838System.loadLibrary("codec2") before Python import (see T383838MeshChatApplication).
• Keep RNS panic containment and T383838panic_on_interface_error = No.

Key files

• T383838android/app/src/main/java/com/meshchatx/MainActivity.java
• T383838android/app/src/main/java/com/meshchatx/rnode/RNodeFlasherActivity.java
• T383838android/app/src/main/java/com/meshchatx/rnode/UsbSerialHub.java
• T383838android/app/src/main/java/com/meshchatx/rnode/Esp32SerialFlasher.java
• T383838android/app/src/main/java/com/meshchatx/MeshChatApplication.java
• T383838android/app/src/main/java/org/able/BLE.java
• T383838android/app/src/main/python/meshchat_wrapper.py
• T383838android/app/src/main/python/jnius/
• T383838android/app/src/main/python/usb4a/
• T383838android/app/src/main/python/able/
• T383838meshchatx/android_codec2.py
• T383838meshchatx/src/backend/android_rnode/
• T383838meshchatx/src/frontend/js/rnode/AndroidBridge.js
• T383838docs/agents/conventions/android.md

Verification

• Unit / bridge-focused tests if present for the change.
• Emulator smoke when file chooser, storage, or boot paths change (CI workflow when available).
• For identity picker changes, also follow T383838identity-restore.


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────